package com.ruoyi.system.service.impl;

import com.ruoyi.system.entity.InspectionPeriod;
import com.ruoyi.system.entity.InspectionPeriodName;
import com.ruoyi.system.mapper.InspectionPeriodMapper;
import com.ruoyi.system.mapper.InspectionPeriodNameMapper;
import com.ruoyi.system.service.InspectionPeriodNameService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 周期段表名 服务实现类
 * </p>
 *
 * @author liushuai 
 * @since 2023-03-07
 */
@Service
public class InspectionPeriodNameServiceImpl implements InspectionPeriodNameService {


    @Resource
    private InspectionPeriodNameMapper inspectionPeriodNameMapper;

    @Override
    public List<InspectionPeriodName> queryByPage(InspectionPeriodName inspectionPeriodName) {
        return inspectionPeriodNameMapper.queryAllByLimit(inspectionPeriodName);
    }

    @Override
    public InspectionPeriodName queryById(Integer id) {
        return this.inspectionPeriodNameMapper.queryById(id);
    }

    @Override
    public InspectionPeriodName insert(InspectionPeriodName inspectionPeriodName) {
        this.inspectionPeriodNameMapper.insert(inspectionPeriodName);
        return inspectionPeriodName;
    }

    @Override
    public InspectionPeriodName update(InspectionPeriodName inspectionPeriodName) {
        this.inspectionPeriodNameMapper.update(inspectionPeriodName);
        return this.queryById(inspectionPeriodName.getId());
    }

    @Override
    public boolean deleteById(Integer id) {
        return this.inspectionPeriodNameMapper.deleteById(id) > 0;
    }


}
